import unittest
from HTMLTestRunner import HTMLTestRunner
import os
import time


suite = unittest.defaultTestLoader.discover('case', 'testcase_*')

report_path = os.path.abspath('report')
file_path = os.path.join(report_path, time.strftime('%Y%m%d%H%M%S')+'-测试报告.html')

with open(file_path, 'wb') as f:
    runner = HTMLTestRunner(
        title='测试报告标题',
        description='测试描述1212122',
        tester='张三|力士',
        stream=f,
    )

    runner.run(suite)